extends ./index.jade

block content
	.rightSide
		.container-fluid
			.row
				.col-sm-10.col-sm-offset-1
					.row.managerOnly
						label 选择你要操作的学校
						select#schoolSelect
						a.btn.btn-primary.pull-right.goodsQuery 查询
					.row
						label 选择要添加食品到哪个食堂
						select#shopSelect
					hr
					.row.text-center
						.underLine.col-sm-6.active
							a.mutedLink(href='#tab1') 1.选择你要导入的商品
						.underLine.col-sm-6
							a.mutedLink(href='#tab2') 2.确认你要导入的商品
					.row#tab1.tab
						.row
							table.table.table-hovered.table-bordered#selectTable
						.row
							a.btn.btn-primary.addAll 添加该页所有商品到待导入列表
						.row.text-right.forcedVerticalCenter
							#paginator1.paginator
							span.marginLeft.marginRight
								|共
								span#total
								|条记录
					.row#tab2.tab
						.row
							table.table.table-hovered.table-bordered#selectedTable		
						.row
							a.btn.btn-danger.removeAll 清空待导入列表
						.row.text-right.forcedVerticalCenter
							#paginator2.paginator
							span.marginLeft.marginRight
								|共
								span#total2
								|条记录
						.row.text-center
							a.btn.btn-success.import 确认导入

	script(type='text/x-dot-template' id='schoolTmpl')
		{{~it:school}}
		option(value='{{=school.id}}') {{=school.name}}
		{{~}}
	script(type='text/x-dot-template' id='shopTmpl')
		{{~it:shop}}
		option(value='{{=shop.id}}') {{=shop.name}}
		{{~}}
	script(type='text/x-dot-template' id='selectTableTmpl')
		thead
			th 商品
			th 名称
			th 价格
			th 操作
		tbody
			|{{~it:goods}}
			tr
				td
					img.previewImg(src='{{=goods.item_main_img}}')
				td {{=goods.item_name}}
				td {{=goods.item_price}}
				td 
					a.btn.btn-success.addToImport(data-id='{{=goods.num_iid}}') 添加到待导入列表
			|{{~}}
	script(type='text/x-dot-template' id='selectedTableTmpl')
		thead
			th 商品
			th 名称
			th 价格
			th 操作
		tbody
			|{{~it:goods}}
			tr
				td
					img.previewImg(src='{{=goods.item_main_img}}')
				td {{=goods.item_name}}
				td {{=goods.item_price}}
				td 
					a.btn.btn-danger.removeToImport(data-id='{{=goods.num_iid}}') 从待导入列表移除
			|{{~}}
	link(rel='stylesheet' href='/css/lib/select2.min.css')
	script(src='/js/lib/require.js' data-main='/js/import_goods')